﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<skags.Models.Child>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Skrá börn
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="navigation">
<% Html.RenderPartial("IndexNavigation"); %>
</div>
<div id="content">
    <p><br />
    <% using (Html.BeginForm()) { %>
        <%: Html.ValidationSummary(true, "Ekki tókst að stofna aðgang. Vinsamlegast farið yfir það sem var sett inn og reynið aftur.") %>
        <div>
            <fieldset>
                <legend>Upplýsingar um barnið</legend>
                <div class="editor-label">
                    Nafn:
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.Name)%>
                    <%: Html.ValidationMessageFor(m => m.Name)%>
                </div>
                
                <div class="editor-label">
                    Kyn:
                </div>
                <div class="editor-field"> 
                    <!-- Athugið að strákar fá gildið "True" og stelpur gildið "False" -->
                    Strákur: <%: Html.RadioButtonFor(x => x.Sex, "True") %>
                    Stelpa: <%= Html.RadioButtonFor(x => x.Sex, "False", new { Checked = "checked" })%>
                    <%: Html.ValidationMessageFor(m => m.Sex)%>
                </div>
                <br />
                <div class="editor-label">
                    Lýsing:
                </div>
                <div class="editor-field">
                    <%: Html.TextAreaFor(m => m.Description) %>
                    <%: Html.ValidationMessageFor(m => m.Description)%>
                </div>
                <div class="editor-label">
                    Fæðingardagur:
                </div>
                <div>
                    <%: Html.TextBoxFor(m => m.BirthDate)%>
                    <%: Html.ValidationMessageFor(m => m.BirthDate)%>
                </div>
                <script type="text/javascript">
                    $(function () {
                        $.datepicker.setDefaults($.datepicker.regional['is']);
                        $.datepicker.setDefaults({ dateFormat: 'dd/mm/yy' });
                        $("#BirthDate").datepicker({ changeYear: true });
                        $("#BirthDate").datepicker();
                    });
                </script>
                <input type="submit" name="submit_child" value="Skrá barn" /><br />
            </fieldset>
        </div>
    <% } %>
</div>
</asp:Content>

